package selfview.sufutian.com.myapplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import selfview.sufutian.com.myapplication.draw2d.DrawAPIView;

/**
 * Created by sufutian on 2017/7/25.
 */

public class Draw2dAPIActivity extends Activity {


    public static void toActivity(Activity activity) {
        Intent intent = new Intent(activity, Draw2dAPIActivity.class);
        activity.startActivity(intent);

    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.draw_2d_api);
        init();
    }

    private void init() {
        LinearLayout layout = (LinearLayout) findViewById(R.id.root);
        final DrawAPIView view = new DrawAPIView(this);
        view.setMinimumWidth(1080);
        view.setMinimumHeight(1920);
        //通知view组件重绘
//        view.invalidate();
        layout.addView(view);
        view.moveView();
    }
}
